Fix descriptions of keys involving meta when showing keymaps
authorJustin Burkett <justin@burkett.cc>
Sat, 24 Feb 2018 21:29:33 +0000 (16:29 -0500)
committerJustin Burkett <justin@burkett.cc>
Sat, 24 Feb 2018 21:29:33 +0000 (16:29 -0500)
which-key.el

index fa865bf466a871997502580a967d13b917af597a..8d7256f42e0dd6746605c303a1a9c2fc7b2b9392 100644 (file)
@@ -1658,15 +1658,14 @@ alists. Returns a list (key separator description)."
   (let (bindings)
     (map-keymap
      (lambda (ev def)
-       (let ((key (if prefix
-                      (concat prefix " " (key-description (list ev)))
-                    (key-description (list ev)))))
-         (unless (string-match-p which-key--ignore-keys-regexp key)
+       (let* ((key (append prefix (list ev)))
+              (key-desc (key-description key)))
+         (unless (string-match-p which-key--ignore-keys-regexp key-desc)
            (if (and all (keymapp def))
                (setq bindings
                      (append bindings (which-key--get-keymap-bindings def t key)))
              (cl-pushnew
-              (cons key
+              (cons key-desc
                     (cond
                      ((keymapp def) "Prefix Command")
                      ((symbolp def) (copy-sequence (symbol-name def)))